import {getBaseCategoryList,getBannerList} from '@/api'
const state = {
  // 初始值
  list:[],
  bannerList:[]
};
const mutations = {
  GETGORYLIST(state,goryList){
    state.list = goryList
  },
  GETBANNER(state,bannerList){
    state.bannerList = bannerList
  }
};
const actions = {
  async getGoryList(context){
    let res = await getBaseCategoryList()
    if(res.code == 200){
      context.commit("GETGORYLIST",res.data)
    }
   },
  async getBanner(context){
    console.log('ooooo');
    let res = await getBannerList()
    console.log('lll',res);
    if(res.code == 200){
      context.commit('GETBANNER',res.data)
    }
  }
};
const getters = { };
export default {
  state,
  mutations,
  actions,
  getters
}